const dbpool=require("../config/dbpoolconfig");

const userController={
    checkUser(req,res){
        console.log(req.query.username);
        dbpool.connect("select * from t_user where username=?",
        [req.query.username],
        (err,data)=>{
            // console.log(err);
            // console.log(data);
            if(!err){
                if(data.length>0){
                    res.send("用户名存在");
                }else{
                    res.send("用户名不存在");
                }
            }
        })
    }
    
}

module.exports=userController;